{% extends 'base.html' %}
{% block content %}
<h1>News:</h1>

{% if latest_news_list %}
    <ul>
    {% for post in latest_news_list %}
        <li><a href="/news/{{ post.id }}/">{{ post.title }} <br> {{ post.posted }} </a></li>
    {% endfor %}
    </ul>
{% else %}
    <p>No posts are available.</p>
{% endif %}
{% if user.is_staff %}
<H1> New Post </H1>
<form action="." method="post">
{% csrf_token %}
Title: {{ postform.title }}
<br> <br>
Body:  {{ postform.body }}
<br>
<br>
<input type="submit" value="Submit" />
</form>
{% endif %}

{% endblock %}